<?php

namespace App\Models\WorkOrder;

use App\Models\BaseModel;
use App\Models\Traits\KfUid;

class WorkOrderResetModel extends BaseModel
{
    use KfUid;

    protected $table = 'work_order_resets';

    protected $fillable = [
        'shopId',
        'problemChildId',
        'unbind',
    ];

    public static function getProblemChildIdsByShopId(int $shopId): array
    {
        return self::query()->where('shopId', $shopId)->pluck('problemChildId')->unique()->values()->toArray();
    }
}
